package cn.tedu.micro.demo.order.feign;

import cn.tedu.micro.demo.common.pojo.protocol.JsonResult;
import cn.tedu.micro.demo.common.pojo.vo.GunInfoVO;
//import cn.tedu.micro.demo.order.config.GlobalFeignCookieConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * get http://localhost:8000/device/gun/info/{gunId}
 */
//添加客户端注解 类似@Mapper
@FeignClient(name="device-service"/*,configuration = GlobalFeignCookieConfig.class*/)
public interface DeviceFeignClient {
    //具体在device中 有很多接口 请求路径 参数 返回值 请求方式都不同
    @GetMapping("/device/gun/info/{gunId}")
    public JsonResult<GunInfoVO> getGunStatus(@PathVariable Integer gunId/*, @CookieValue("token") String token,@RequestHeader("name") String name*/);
}
